package com.bbx.taxi.client.Adapter.Plane;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.bbx.taxi.official.R;
import com.bbx.taxi.client.Activity.Address.AddAddressActivity;
import com.bbx.taxi.client.Activity.Menu.SetActivity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

/**
 * 航班号的具体信息
 */
public class FlightDetaileAdapter extends BaseAdapter {
	private List<Map<String, String>> list;
	private Activity main;
	public FlightDetaileAdapter(Activity context,List<Map<String, String>> list) {
		this.list=list;
	   main=context;
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
		
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		ViewHolder viewholder;
		if(convertView==null){      
		LayoutInflater inflater=LayoutInflater.from(main);
		convertView=(View)inflater.inflate(R.layout.item_flight_detaile,null);        
		viewholder=new ViewHolder();
		viewholder.tv_city=(TextView)convertView.findViewById(R.id.tv_city);
		viewholder.tv_date=(TextView)convertView.findViewById(R.id.tv_date);
		viewholder.tv_time=(TextView)convertView.findViewById(R.id.tv_time);
		convertView.setTag(viewholder);	
		}
		else viewholder=(ViewHolder)convertView.getTag();
		viewholder.tv_city.setText(list.get(position).get("city"));
		viewholder.tv_date.setText(list.get(position).get("time"));
		return convertView;
		
}
	public class ViewHolder{                   
		TextView tv_city,tv_date,tv_time;
	}
}
